package com.example.javaeespringioc.demos;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("demo")
@RestController
public class demo3 {
    @Value("${string.str1}")
    String str1;
    @Value("${string.str2}")
    String str2;
    @Value("${string.str3}")
    String str3;
    @RequestMapping("/getStr")
    String getStr(){
        System.out.println(str1);
        System.out.println(str2);
        System.out.println(str3);
        return "...";
    }

    @Autowired
    private Student student;

    @RequestMapping("/getStudent")
    String getStudent(){
        return student.toString();
    }

    @Autowired
    private ListConfig listConfig;

    @RequestMapping("/getList")
    String getList(){
        return listConfig.toString();
    }

    @Autowired
    private MapConfig mapConfig;

    @RequestMapping("/getMap")
    String getMap(){
        return mapConfig.toString();
    }
}
